package com.wjz.log.controller;

import com.wjz.log.annotation.WebLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wjz
 * @date 2021/5/31 16:13
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @WebLog("有参有返回测试")
    @GetMapping("/demo")
    public String demo(String str) {
        System.out.println("参数===》" + str);
        return "demo";
    }

    @WebLog("有参无返回测试")
    @GetMapping("/demo2")
    public void demo2(String str) {
        System.out.println("参数2===》" + str);
    }

    @WebLog("无参无返回测试")
    @GetMapping("/demo3")
    public void demo3() {
        System.out.println("demo3===》");
    }

    @WebLog("错误测试")
    @GetMapping("/demo4")
    public void demo4() {
        int i = 1 / 0;
    }
}
